﻿<template>
  <div class="bg_get_msg_container">
    <div class="bg_get_msg_main clearfix">
      <div class="get_time_m" v-on:click.self="openPicker">
        <mt-datetime-picker
          ref="picker"
          type="date"
          year-format="{value}"
          month-format="{value}"
          date-format="{value}"
          :startDate="startDate"
          @confirm="handleConfirm"
          v-model="pickerValue">
        </mt-datetime-picker>
        {{pickerValue}}
        <!--{{!!pickerValue?"请选择时间":pickerValue}}-->
      </div>
      <input type="text" class="get_time_m get_input" placeholder="请输入地点">
      <textarea name="" id="" class="get_m_text" placeholder="其他说明2"></textarea>
    </div>
    <div class="next_box clearfix">
      <div class="next_btn_base">
        添加语音
      </div>
      <div class="next_btn_base">
        下一步
      </div>
    </div>
  </div>

</template>
<script>
  import {mapState, mapMutations,mapActions,mapGetters} from 'vuex';
  import common from "../../common/common.js";

  import { DatetimePicker } from 'mint-ui';
  //limit_Scroll
  //import limit_scroll from "../../static/js/limit_scroll.js"
  const qs = require('qs');
  import  "../../filter/filter.js"

export default {
  name: 'bg_get_img',
  data () {
    return {
      startDate:"",
      pickerValue:"",
    }
  },
  created:function () {
      let now_year = new Date();
      this.startDate = new Date(now_year.getFullYear().toString())
  },
  watch: {
    pickerValue: function (val) {
      if( typeof(this.pickerValue) != "object")return;
      this.pickerValue = this.pickerValue.getFullYear()+ "-" + (this.pickerValue.getMonth()+1) + "-" + this.pickerValue.getDate()
    },
  },
  methods: {
    openPicker() {
      this.$refs.picker.open();
    },
    handleConfirm(e){
        console.log(e)
        console.log(this.pickerValue)
        console.log("handleConfirm")
      this.$refs.picker.close()
    }
  },
  components: {

  }
}
</script>
<style scoped lang="scss">
 @import "../../../static/sass/thom_c_size.scss";
 @import "../sass/bg_get_msg_container.scss";

</style>
